package com.ly.springboot.config;


import com.ly.springboot.flter.MyFilter;
import org.springframework.boot.web.servlet.FilterRegistrationBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class FilterConfig {
      @Bean
    public FilterRegistrationBean filterRegist(){
          FilterRegistrationBean registration=new FilterRegistrationBean();
          registration.setFilter(new MyFilter());
          registration.setName("MyFilter");
          registration.addUrlPatterns("/index");
          registration.setOrder(5);
          return registration;
      }
}
